package com.shure.surdes.modules.survey.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shure.surdes.modules.survey.domain.Survey;
import com.shure.surdes.modules.survey.query.SurveyQuery;
import com.shure.surdes.modules.survey.vo.SurveyVo;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 问卷Mapper接口
 *
 * @author Shure
 * @date 2021-10-18
 */
@Mapper
public interface SurveyMapper extends BaseMapper<Survey> {

    /**
     * 删除问卷
     *
     * @param surveyId 问卷主键
     * @return 结果
     */
    public int deleteSurveyBySurveyId(Long surveyId);

    /**
     * 批量删除问卷
     *
     * @param surveyIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSurveyBySurveyIds(Long[] surveyIds);

    /**
     * 批量发布问卷
     *
     * @param surveyIds 需要发布的问卷主键集合
     * @return 结果
     */
    public int publishSurveyBySurveyIds(Long[] surveyIds);

    /**
     * 永久删除问卷
     *
     * @param surveyId 问卷主键
     * @return 结果
     */
    public int removeSurveyBySurveyId(Long surveyId);

    /**
     * 删除问卷
     *
     * @param surveyIds 问卷主键集合
     * @return 结果
     */
    public int removeSurveyBySurveyIds(Long[] surveyIds);

    /**
     * 批量还原问卷
     *
     * @param surveyIds 需要发布的问卷主键集合
     * @return 结果
     */
    int restoreSurveyBySurveyIds(Long[] surveyIds);

    /**
     * 撤销发布问卷
     *
     * @param surveyId 需要发布的问卷主键
     * @return 结果
     */
    int revokeSurveyBySurveyId(Long surveyId);

    Page<SurveyVo> analysisList(Page page, @Param("query") SurveyQuery query);
}
